#!/bin/bash
########################################################################   
#    Dooplet is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    Dooplet is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with Dooplet.  If not, see <http://www.gnu.org/licenses/>.
#######################################################################
#    Authors: Karthikeyan Manivannan
#
######################################################################

#script installs the dooplet as a cron job
#that contacts the dooplet server every minute  
#the dooplet server can be set in the dooplet.py file

#First point to prepare a package
#set -e

CHECKBOX_SHARE="/usr/share/checkbox"
if [ ! -d "$CHECKBOX_SHARE/configs/checkbox.ini.old" ];
then
	echo "moving $CHECKBOX_SHARE/configs/checkbox.ini" 
	mv "$CHECKBOX_SHARE/configs/checkbox.ini" "$CHECKBOX_SHARE/configs/checkbox.ini.old"
fi

if [ ! -d "$CHECKBOX_SHARE/olds" ];
then
	echo "creating $CHECKBOX_SHARE/olds" 
	mkdir "$CHECKBOX_SHARE/olds"
fi
mv "$CHECKBOX_SHARE/jobs/*" "$CHECKBOX_SHARE/olds/"

